#pragma once
#include "DGGSGeometry.hpp"

_NNU_DGGS_BEGIN
namespace Feature {

    class DGGSFeatureClass;
    /// <summary>
    /// 格网系统的Feature
    /// </summary>
    class DGGSFeature 
    {
        friend class DGGSFeatureClass;
    private:
        long long int           _featureID=-1;                 //Fid

        DGGSGeometry*           _geometry = nullptr;        //几何属性
        
        DGGSFeatureClass*       _featureClass = nullptr;    //featureClass

        DGGSFeature(DGGSFeatureClass& _featureClass);

    public:
        ~DGGSFeature();

        /// <summary>
        /// 设置Id
        /// </summary>
        /// <param name="fId">fId</param>
        void setFID(long long int fId){ this->_featureID=fId;};

        /// <summary>
        /// 获取Id
        /// </summary>
        /// <returns>Fid</returns>
        long long int getFID(){return this->_featureID;};

        /// <summary>
        /// 设置几何要素
        /// </summary>
        /// <param name="geometry">几何对象</param>
        void setGeometry(DGGSGeometry* geometry);

        /// <summary>
        /// 获取几何要素
        /// </summary>
        /// <returns>Geometry</returns>
        DGGSGeometry* getGeometry() { return this->_geometry; }

        /// <summary>
        /// 获取层级
        /// </summary>
        /// <returns>Geometry</returns>
        int getLevel() ;

        /// <summary>
        /// 获取要素类型
        /// </summary>
        /// <returns>elementType</returns>
        DGGSElementType getElementType();

        /// <summary>
        /// 获取几何类型
        /// </summary>
        /// <returns>GeomType</returns>
        DGGSGeometryType getGeomType();

        /// <summary>
        /// 获取格网类型
        /// </summary>
        /// <returns>GridType</returns>
        DGGSGridType getGridType();

        bool operator==(const DGGSFeature& other)const;

        bool operator!=(const DGGSFeature& other)const;
    };
}
_NNU_DGGS_END